System for generating efficient and compact update packages

ABSTRACT

A system for generating efficient and compact update packages makes it possible to process a source binary image of software/firmware for an electronic device and a target binary image in order to generate a compact update package. It generates bubbles information that is optionally packaged with the generated update package. Together, the bubbles information and the update package, when delivered to an electronic device, facilitate the upgrade of the electronic device to a new or different version. The system for generating efficient and compact update packages selectively employs residue generation/computation and entropy computation, in addition to other techniques, in order to make the update package more compact.

CROSS-REFERENCE TO RELATED APPLICATIONS/INCORPORATION BY REFERENCE

This patent application makes reference to, claims priority to andclaims the benefit from U.S. Provisional Patent Application Ser. No.60/405,253, entitled “Firmware Update Network And Process EmployingPreprocessing Techniques,” filed on Aug. 22, 2002, U.S. ProvisionalPatent Application Ser. No. 60/415,620, entitled “System for GeneratingEfficient And Compact Update Packages,” filed on Oct. 2, 2002, U.S.Provisional Patent Application Ser. No. 60/441,867, entitled “MobileHandset Update Package Generator That Employs Nodes Technique,” filed onJan. 22, 2003, and U.S. Provisional Patent Application Ser. No.60/447,977, entitled “Update Package Generator Employing PartialPredictive Mapping Techniques For Generating Update Packages For MobileHandsets,” filed on Feb. 18, 2003.

The complete subject matter of each of the above-referenced U.S. patentapplications is hereby incorporated herein by reference, in itsentirety. In addition, this application makes reference to U.S.Provisional Patent Application Ser. No. 60/249,606, entitled “System andMethod for Updating and Distributing Information,” filed Nov. 17, 2000,and International Patent Application Publication No. WO 02/41147 A1,entitled “Systems And Methods For Updating And DistributingInformation,” publication date Mar. 23, 2002, the complete subjectmatter of each of which is hereby incorporated herein by reference, inits entirety.

This application is also related to the following co-pendingapplications, the complete subject matter of each of which is herebyincorporated herein by reference in its entirety:

Ser. No. Docket No. Title Filed Inventors 14121US02 Firmware UpdateNetwork Aug. 21, Chen and Process Employing 2003 Gustafson PreprocessingTechniques 14312US02 Mobile Handset Update Aug. 21, Chen PackageGenerator 2003 That Employs Nodes Technique 14911US02 Update PackageGenerator Aug. 21, Lilley Employing Partial 2003 Predictive Mapping forGenerating Update Packages for Mobile Handsets

FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

[Not Applicable]

MICROFICHE/COPYRIGHT REFERENCE

[Not Applicable]

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to the generation of updatepackages for software and firmware, and, more specifically, to thetechniques employed in generating compact and efficient update packagesthat can be used to upgrade software/firmware from one version toanother.

2. Background of the Art

Electronic devices, such as mobile phones and personal digitalassistants (PDAs), often contain firmware and application softwareeither provided by the manufacturer of the electronic devices, bytelecommunication carriers, or by third parties. The firmware andapplication software often contain software bugs. New versions of thefirmware and software are periodically released to fix the bugs or tointroduce new features, or both. There is a fundamental problem inproviding access to new releases of firmware and software. Theelectronic devices are often constrained in terms of resources, such asavailable memory. Attempts to upgrade firmware or software by end-usersoften result in making the device, or some features of the deviceinoperable. Specifically, changing firmware in electronic devicesrequires a great deal of caution as unsuccessful attempts may make thedevice inoperable. Also, attempts to upgrade firmware and/or software inconstrained devices may be hampered by limited user interactioncapabilities and slow communication speeds on these devices. Inaddition, determination of the version of firmware or software that maycurrently be executed on the electronic devices may not be an easy task,especially if such determination must be made with minimal end-userinteraction.

When an electronic device manufacturer/supplier wants to upgrade anelectronic device user's executable applications, a binary differencefile may be distributed from the supplier to the user. The user may thenupdate the executable image with that difference file. Often, thechanges required for the upgrade may be small, however, the binarydifference file may be very large, and that may cause problems duringthe upgrading process.

Further limitations and disadvantages of conventional and traditionalapproaches will become apparent to one of ordinary skill in the artthrough comparison of such systems with the present invention as setforth in the remainder of the present application with reference to thedrawings.

BRIEF SUMMARY OF THE INVENTION

Aspects of the present invention may be seen in a method for generatingefficient and compact update packages in a generation system thatcomprises a parser for generating distance files between the sourceimage and the target image; a bubble generator for generating bubbles; aconfiguration manager for facilitating configuration of the memory ofthe electronic device; a bubble layout manager for modifying the sourceimage to look similar to the target image, the bubble layout managerhaving a bubbler and a predictor for aligning objects between the sourceand target images; and a generator for generating update packages, thegenerator having a residue processing unit for minimizing the number ofinstructions requiring large spaces in the update package, and an updatepackage output for generating the update package. The system may furthercomprise a an entropy calculator for calculating the entropy of asegment of data, and a compression unit for facilitating compression ofthe update package. The method for generating efficient and compactupdate packages may involve determining files for the source image andthe target image; parsing the determined files for the source image andthe target image to create distance files for the images; splitting thedistance files into one or more parts; verifying the distancesdetermined between the source image and the target image; generatingbubble information; configuring the bubble information according toconfiguration settings; applying the bubble information to the sourceimage; generating an update package; and outputting the update packageand the bubble information.

These and other features and advantages of the present invention may beappreciated from a review of the following detailed description of thepresent invention, along with the accompanying figures in which likereference numerals refer to like parts throughout.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a block diagram of an example of a system forgenerating efficient and compact update packages, in accordance with anembodiment of the present invention.

FIG. 2 illustrates a block diagram of an example of a generator forgenerating efficient and compact update packages, in accordance with anembodiment of the present invention.

FIG. 3 illustrates a block diagram of an example of a flow model forgenerating efficient and compact update packages, in accordance with anembodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 1 illustrates a block diagram of an example of a system forgenerating efficient and compact update packages 105, in accordance withan embodiment of the present invention. The system 105 comprises aparser 107, a bubble generator 109, a configuration manager 111, abubble layout manager 121, and a generator 123. The bubble layoutmanager 121 comprises a bubbler 113 and a predictor 115. The generator123 comprises a residue processing unit 117 and an update package output119.

The parser 107 may be used for parsing “elf” files or executable imagesto determine the location of symbols and values of offsets forbranch-link instructions, load instructions, pointers, etc. The parser107 may be employed to generate distance files or “.dist” files. Adistance file contains “distance values” of a source image and a targetimage of a firmware/software of an electronic device, where the targetimage may be an updated or upgraded version of the source image of thefirmware/software.

In one embodiment, the parser 107 may be employed to pre-process map or“map” files and symbol or “.sym” files to generate “.dist” files. Hence,“.dist” files may be generated for both the source and the target binaryimages of firmware/software of an electronic device.

The bubble generator 109 may then process the “.dist” files generatedfor the source and the target images by the parser 107. The bubblegenerator 109 may then output a list of bubbles into a bubbles file. Thelist of bubbles may contain “Worm” bubbles, indicating a growth in thesize of objects, functions, and/or sections of memory in the targetimage in comparison with the corresponding object or function in thesource image of firmware/software. The list of bubbles may also contain“Black” bubbles, indicating a reduction in the size of objects,functions, and/or sections of memory in the target image in comparisonwith the corresponding object or function in the source image offirmware/software.

In one embodiment, the bubble generator 109 may process the “.dist”files generated for the source and the target images by the parser 107,to generate configuration or “.cfg” files. The bubble generator 109 mayemploy one or more “.dist” files, one for each type of memory componentin an electronic device, such as ROM, RAM, FLASH, etc. The bubblegenerator 109 may then generate a single output file, for example“bubbles.cfg.”

The configuration manager 111 facilitates the specification of theconfiguration of the memory of the electronic device on which the sourceand the target images of the firmware/software may be executed. In oneembodiment, the configuration manager 111 may facilitate the generationof a configuration file, or a “.cfg” file. The configuration file mayspecify a number of configuration parameters including a base address ofthe RAM, a top address+1 of the RAM (that may be called RAMlimit), a topaddress+1 of the binary image (that may be called IMAGElimit). Theconfiguration file may also specify a top address+1 of the code sectionthat may be required for some microprocessor architectures, such asTHUMB (that may be called CODElimit). In addition, the configurationfile may specify a top address+1 of the boot block (that may be calledBblimit), a base address of ROM (that may be called ROMbase), an enableor disable instruction disassembler indicator that may be called ARMb1,etc.

The output of the bubble generator 109 may be processed by the bubblelayout manager 121. The bubble layout manager 121 may process the sourceimage of a firmware/software for an electronic device, and maymanipulate the aforementioned source image to line up symbolicaddresses, such as addresses in branch links, pointers, etc. withcorresponding symbolic addresses in the target image of thefirmware/software for the electronic device. As a result, the sourceimage may be modified to look similar to the target image, inpreparation for the process of generating an update package by thegenerator 123. The predictor 115 may be employed to encapsulateplatform-specific issues and platform-specific processing. The predictor115 may be utilized to align objects or code in the source image withobjects or code in the target image. The predictor 115 may compare bytesfrom the source image to bytes from the target image to establish analignment between the two images, or between portions of the two images.

The generator 123 generates update packages that indicate the differencebetween any two given versions of firmware/software. The differences maybe expressed using a set of instructions and associated data. In oneembodiment, the system may utilize instructions such as CPY, DUP, SET,SETR, and DEL, explained hereinafter.

In one embodiment, the generator 123 may process the output of thebubble layout manager 121 to determine an appropriate bank order ofupdates. The bank order may contain the order in which sections of theobjects or code from the source and target images of thefirmware/software may be updated. The bank order may be determined basedon the order that may provide the most size-efficient update package.Details regarding the significance of the bank order choice areexplained hereinafter.

Once the bank order is determined, the generator 123 may generate theupdate package. While generating the update package, the generator 123may utilize the residue processing unit 117 to minimize the number ofSET and SETR instructions used in the update package being generated.The residue processing unit 117 may generate compact segments of SET andSETR instructions that form a portion of a generated update package forthe firmware/software of the electronic device. The update packageoutput 119 may then save the generated update package into a file,external device, an output stream, etc.

The update package generated for a difference file may includeinstructions such as, CPY, DUP, SET, SETR, and DEL, as mentionedhereinabove. DUP may be used to indicate that a specified number ofbytes remain the same in a target image from the source image of thefirmware/software. CPY may be used to indicate that a specified numberof bytes is the same as the preceding equal number of bytes. DEL may beused to indicate that a specified number of bytes in the source imagemay not appear in the target image. SET and SETR are used to add new andchanged number of bytes into the target image that do not occur in thesource image. SET uses completely new information to add to the image,whereas SETR may use an existing segment of information. A benefit ofusing SETR is that, depending on the stage of the generation process,SETR may utilize a segment of information that appears in the sourceimage, the modified/updated source image, or the target image. In such acase, the bank order may be considered. The order in which segments ofthe memory are updated determines at any stage which segments areavailable as source, updated, or target. The order that provides theoptimal/minimal number of instructions, such as SET and SETR, may be theoptimal bank order.

FIG. 2 illustrates a block diagram of an example of a generator 205 forgenerating efficient and compact update packages, in accordance with anembodiment of the present invention. The generator 205 comprises aparser 207, a bubble generator 209, a configuration manager 211, abubbler 213, a predictor 215, a residue processing unit 217, an updatepackage output 219, an entropy calculator 221, and a compression unit223. The preprocessing steps that may be utilized to prepare the binaryimages of firmware/software for the generation of an update package mayinclude the processing of binary files, such as “.bin” files, map files,such as “.map” files, symbol files, such as “.sym” files, etc. for boththe source image and the target image.

In one embodiment, the preprocessing steps, that may be conducted by thegenerator 205 may comprise generation of binary files. Such binary filesmay include a binary image file corresponding to the source binary imagein addition to bubbles that make it look similar to the target binaryimage. Another binary file may be a binary image file that may includepreprocessing instructions in addition to the bubbles used in updatingthe source image to the target image. The generator 205 may subsequentlyprocess the source binary image file that contains the bubbles or thesource binary file that contains the bubbles and the preprocessinginstructions, along with the target binary image file to generate anupdate package.

The entropy calculator 221 may be employed by the residue processingunit 217 to calculate the entropy of the data associated with aset-buffer, which is a buffer of data assembled from one or more SET orSETR instructions of an update package. In one embodiment, theset-buffer may contain the data associated with all SET and SETRinstructions encountered during any given stage of the processing by thegenerator 205. Based on the entropy calculated, the residue processingunit 217 may select a SET instruction or a SETR instruction to representcreation/duplication/modification of a current segment of a piece ofcode or module within the firmware/software being processed.

In one embodiment, the entropy may be calculated by calculating thefrequency of occurrence of each byte in a buffer, calculating theprobability of each byte occurring, and employing the frequency ofoccurrence and/or the probability in an entropy function. The codefragment shown below illustrates an example of an entropy calculation,where prob is an array of calculated probabilities, and prob[i] refersto an i^(th) element in the array:

for (i=0; i<256; i++) { entropy += (prob[i] != 0.0 ? prob[i] * log(1.0/prob[i] / log(2.0) : 0.0); }

Using the SET instruction usually yields high entropy values, because itintroduces a set of new values for a certain number of bytes. However,an alternative embodiment may reduce the entropy of the data introducedby the SET instruction, and as a result offer a high compression rate tomake an update package more efficient. An alternative embodiment mayutilize subtracting SET data from corresponding data in the source, andusing the difference between the target and source data instead of justthe target data. For example, the SET or target data may look like:

0x08 0x25 0xF2 0x04 0x08 0x26 0xF2 0x04 0x08 0x30 0x4A 0x0C 0x08 0x310x4A 0x0C

This pattern has moderate entropy and may offer a compression rate near2:1. The source data corresponding to the SET or target data may looklike:

0x08 0x25 0xF2 0x08 0x08 0x26 0xF2 0x08 0x08 0x30 0x4A 0x04 0x08 0x310x4A 0x04

The difference between the SET data and the source data would look like:

0x00 0x00 0x00 0xFC 0x00 0x00 0x00 0xFC 0x00 0x00 0x00 0x08 0x00 0x000x00 0x08

In this case, the entropy of the difference is extremely low, which mayoffer a much higher compression rate. Therefore, it may be moredesirable to use the SET instruction with the difference data ratherthan the target data. This technique is not limited to the SETinstruction. In another case the SETR instruction may offer betterresults by finding sections in the source, modified, or target imagesthat may provide the smallest difference between sections of data, henceproviding sequences with lower entropy and better compression rates.Better results may be achieved by utilizing combinations of SET and SETRinstructions. A further enhancement may compute the entropy before andafter calculating the residual for the different sections or segments ofcode and/or data, and for each section or segment, saving the data withthe lowest entropy to the update package.

The compression unit 223 may facilitate compression of update packagesbased on one or more compression techniques. In one embodiment, thecompression unit 223 may provide support for zlib-based compression, aswell as other commercial compression techniques, such as LZ compression,pkzip, etc. A high compression rate results in the generation of moreefficient update packages in a system.

The bubble information generated by the generator 205 may be packagedalong with the update package in one embodiment, or packaged separatelyfrom the generated update package in another embodiment.

In one embodiment, the system may keep a “rough” estimate of locationsof sections of the source data where evaluations of entropy values andcompression may provide better results. In one embodiment, a largefraction of SET instructions may be preceded by a copy instruction, orCPY. In such an embodiment, if a pointer into the source data is keptfor the last copy instruction, the matched SET data will likely resideat that pointer location plus the size of the copy instruction, i.e. thenumber of bytes of data copied. This embodiment assumes locality ofdata.

FIG. 3 illustrates a block diagram of an example of a flow model 305 forgenerating efficient and compact update packages, in accordance with anembodiment of the present invention. The flow model 305 shows exemplarysteps of a process for generating efficient and compact update packagesutilizing bubbles information to make the update packages more compactand efficient. The exemplary process of generating efficient and compactupdate packages starts at a block 307 where map or “.map” files and/orsymbol or “.sym” files for the source binary image of afirmware/software and the target binary image of the firmware/softwaremay be determined. For instance, the “.bin,” “map,” and “.sym” files forboth the source and target images of the firmware/software may beidentified and accessed.

At a next block 309, the map and symbol files may be parsed to createone or more distance or “.dist” files. Then, at a next block 311, thedistance files may be split, if necessary, into one or more parts. Theseparts may correspond to different sections of code or memory. Forexample, if ROM, RAM, and IRAM sections are employed in the source andtarget images, the distance files for each of these memory sections maybe separated and saved in different files.

At block 313, the distances may be verified between the source andtarget images. In one embodiment, each of the distance files, if morethan one exists (for example, a distance file for the different sectionsof memory), may be verified.

At block 315, bubble information may be generated. When the bubbleinformation is generated, the system may utilize a preferred distancespecified by a user or accessed from a default configuration setting.The preferred distance utilized may be computed based on heuristics. Inone embodiment, the bubble information generated may be combined intoone “.cfg” file, where the sequence of bubble information may be basedon the order of the addresses of the various sections of memory of abinary image. For example, if the memory map of an electronic device forthe source/target image, ordered from top to bottom, is ROM, RAM, andIRAM, then the bubble information may be arranged in that order.

Once the bubble information is generated in block 315, the configurationinformation may be retrieved and processed in a step illustrated byblock 317. Later, at a next block 319, the source image may bemanipulated to make it similar in appearance to the target image byapplying the bubble information generated in the earlier block 315. Theapplication of the bubble information to the source image may beperformed by a bubbler utilizing a predictor. Once the bubbleinformation is applied to the source image, the update package may begenerated in a next block 321. The generation of the update package mayalso employ techniques such as residue processing to make the generatedupdate package more compact and efficient. Additionally, compressiontechniques may also be employed.

A next block 323 is where the update package and the bubble informationgenerated may be packaged together or separately and outputted. In oneembodiment, the update package and the bubble information generated maybe packaged together and saved in a file. The process for generatingefficient and compact update packages then ends at block 325.

The system for generating efficient and compact update packagesgenerates bubbles information that may be packaged within the generatedupdate package. The bubbles information, included in the update package,when delivered to an electronic device, facilitates the upgrade of theelectronic device firmware/software to a new version.

While the present invention has been described with reference to certainembodiments, it will be understood by those skilled in the art thatvarious changes may be made and equivalents may be substituted withoutdeparting from the scope of the present invention. In addition, manymodifications may be made to adapt a particular situation or material tothe teachings of the present invention without departing from its scope.Therefore, it is intended that the present invention not be limited tothe particular embodiment disclosed, but that the present invention willinclude all embodiments falling within the scope of the appended claims.

1-33. (canceled)
 34. A computer-readable storage, having stored thereona computer program having a plurality of code sections for generatingupdate packages for updating contents of memory in an electronic device,the code sections executable by a processor for causing the processor toperform the operations comprising: identifying files comprising code orobjects of a source image; identifying files comprising code or objectsof a target image; creating distance information representingdifferences of location of corresponding code or objects in the sourceimage and the target image, using the source image and the target image;generating a list of information items representing growth or reductionin size of the code or objects in the source image in comparison to thecorresponding code or objects in the target image, using the distanceinformation; applying the information items to the source image tocreate a modified source image in which the code or objects more closelyalign with the corresponding code or objects in the target image;generating an update package of difference information using themodified source image and the target image; and outputting the updatepackage and the list of information items to the electronic device forprocessing to update the memory.
 35. The computer-readable storageaccording to claim 34 wherein the identified files for the source imageand the target image are parsed to create the distance information. 36.The computer-readable storage according to claim 34 wherein generatingthe list of information items comprises prediction.
 37. Thecomputer-readable storage according to claim 34 wherein the generationof the update package calculates the entropy of data in the updatepackage.
 38. The computer-readable storage according to claim 34 whereinthe update package and the list of information items are compressedbefore output.
 39. The computer-readable storage according to claim 34wherein the update package and the list of information items arepackaged separately.
 40. The computer-readable storage according toclaim 34 wherein the update package is arranged for updating the memoryas a plurality of banks each comprising a plurality of memory locations.41. The computer-readable storage according to claim 40 whereingenerating the update package determines an order in which to update thebanks to produce a most size-efficient update package.
 42. Thecomputer-readable storage according to claim 34 wherein the differenceinformation is encoded as a set of instructions that are performed bycode in the electronic device.
 43. The computer-readable storageaccording to claim 34 wherein generating an update package comprisescalculating entropy of update package data to select a set ofinstructions for use in the update package.
 44. The computer-readablestorage according to claim 43 wherein the entropy is calculated fordifferent sets of instructions to determine the instruction set yieldingthe smallest entropy value.
 45. The computer-readable storage accordingto claim 34 wherein the electronic device comprises a mobile phone. 46.A mobile electronic device that supports updating of a source image inmemory of the device, the device comprising: at least one processorcommunicatively coupled to storage containing an update package ofdifference information and to the memory, the at least one processoroperating to, at least: receive the update package into the memory;after receiving the update package, modify the source image usinginformation items representing growth or reduction in size of the codeor objects in the source image, to produce a modified source image inwhich the code or objects in the source image more closely align withcorresponding code or objects in the target image; and generate thetarget image using the modified source image, by updating the modifiedsource image using the difference information in the update package. 47.The device according to claim 46 wherein the information itemsrepresenting growth or reduction in size of the code or objects in thesource image are received as part of the update package.
 48. The deviceaccording to claim 46 wherein the update package comprises data and aset of instructions processed by code in the device.
 49. The deviceaccording to claim 46 wherein the update package is arranged to processthe source image as a plurality of banks, each bank comprising aplurality of memory locations.
 50. The device according to claim 49wherein the update package comprises bank order information defining anorder of banks in which to update the plurality of banks.
 51. The deviceaccording to claim 46 wherein the at least one processor operates todecompress the update package.
 52. The device according to claim 46wherein the device comprises a mobile phone.
 53. The device according toclaim 46 wherein the memory comprises FLASH memory.